<template>
	<view class="mainbgc mainpadding" v-if="pageShow">
		<!-- 代发货人 -->
		<view class="mainpadding ffffff radius">
			<view class="flexbetween">
				<view class="bigtext">{{dataAll.order_no}}</view>
				<!-- 0=全部,10=待审核,20=待取货,30=待入库,40=已完成,50=已作废,60=已拒绝,70=拒收 -->
				<view class="daifahuo" style="color: #F3AD3D;" v-show="dataAll.status==10">待审核</view>
				<view class="daifahuo" style="color: #FAA500;" v-show="dataAll.status==20">待取货</view>
				<view class="daifahuo" style="color: #F3AD3D;" v-show="dataAll.status==30">待入库</view>
				<view class="daifahuo" style="color: #0BBDCB;" v-show="dataAll.status==40">已完成</view>
				<view class="daifahuo" style="color: #FD463E;" v-show="dataAll.status==50">已作废</view>
				<view class="daifahuo" style="color: #FD463E;" v-show="dataAll.status==60">已拒绝</view>
				<view class="daifahuo" style="color: #FD463E;" v-show="dataAll.status==70">拒收</view>
			</view>
		</view>
		<!-- 商品名称 -->
		<view class="mainpadding ffffff radius margin_top">
			<view class="header flexbetween">
				<view class="headerchild" style="flex: 1;">商品名称</view>
				<view class="headerchild headercenter" style="flex: 1;">规格</view>
				<view class="headerchild headercenter" style="flex: 0.7;">数量</view>
				<view class="headerchild headerright" style="flex: 0.7;">单价</view>
			</view>
			<view class="content">
				<view class="content_child " v-for="item in dataAll.ordergoods" :key="item.id">
					<view class="flexbetween">
						<view class="huisetext" style="flex: 1;">{{item.goods_info.name}}</view>
						<view class="huisetext headercenter" style="flex: 1;" v-show="item.difference_type==1">
							{{item.goods_info.biggoodsunit.name}}</view>
						<view class="huisetext headercenter" style="flex: 1;" v-show="item.difference_type==2">
							{{item.goods_info.middlegoodsunit.name}}</view>
						<view class="huisetext headercenter" style="flex: 1;" v-show="item.difference_type==3">
							{{item.goods_info.smallgoodsunit.name}}</view>
						<view class="huisetext headercenter" style="flex: 0.7;">*{{item.num}}</view>
						<view class="huisetext headerright" style="flex: 0.7;">￥{{item.price}}</view>
					</view>
					<view class="flexbetween margin_topx">
						<view class="huisetext">备注：{{item.notes}}</view>
					</view>
					<!-- 赠品信息，商品类型不得为退货状态且包含赠品数量 -->
					<view class="flexbetween margin_top" v-show="item.send_num">
						<view class="huisetext" style="color: #ffa126 ;flex: 1;">赠品备注：{{item.send_notes}}</view>
						<view class="huisetext headercenter" style="color: #ffa126 ;flex: 1;"
							v-show="item.difference_type==1">{{item.goods_info.biggoodsunit.name}}</view>
						<view class="huisetext headercenter" style="color: #ffa126 ;flex: 1;"
							v-show="item.difference_type==2">{{item.goods_info.middlegoodsunit.name}}</view>
						<view class="huisetext headercenter" style="color: #ffa126 ;flex: 1;"
							v-show="item.difference_type==3">{{item.goods_info.smallgoodsunit.name}}</view>
						<view class="huisetext headercenter" style="color: #ffa126 ;flex: 0.7;">*{{item.send_num}}
						</view>
						<view class="huisetext headerright" style="color: #ffa126 ;flex: 0.7;">0</view>
					</view>
				</view>
			</view>
			<view class="header flexbetween">
				<view class="headerbottom">合计：</view>
				<view class="headerbottom headercenter">{{dataAll.goods_zl_num}}种({{dataAll.goods_num}}件)</view>
				<view class="headerbottom headerright" style="color:#0BCB41">{{dataAll.total_goods_price}}元</view>
			</view>
		</view>
		<!-- 订单信息 -->
		<view class="mainpadding ffffff radius margin_top">
			<view class="dingdan shanpin">订单号：
				<text class="erbaxs">{{dataAll.order_no}}</text>
			</view>
			<view class="dingdan shanpin margin_top">配送方式：
				<text class="erbaxs">{{dataAll.ps_type==1?"自提":"送货"}}</text>
			</view>
			<view class="dingdan shanpin margin_top">是否开具发票：
				<text class="erbaxs">{{dataAll.kjfp_type==1?"是":"否"}}</text>
			</view>
			<view class="dingdan shanpin margin_top">订单金额：
				<text class="erbaxs" style="color: #0BCB41;">￥{{dataAll.total_goods_price}}</text>
			</view>
			<view class="dingdan shanpin margin_top">商品数量：
				<text class="erbaxs">{{dataAll.goods_num}}</text>
			</view>
			<view class="dingdan shanpin margin_top">商品种类：
				<text class="erbaxs">{{dataAll.goods_zl_num}}</text>
			</view>
			<view class="dingdan shanpin margin_top">备注：
				<text class="erbaxs">{{dataAll.notes}}</text>
			</view>
			<view class="dingdan shanpin margin_top">下单时间：
				<text class="erbaxs">{{dataAll.createtime_text}}</text>
			</view>
		</view>
	</view>
</template>
<script>
	const httpRequest = require("@/commonFun/httpRequest.js")
	export default {
		data() {
			return {
				listid: "",
				dataAll: {},
				httpRequest,
				pageShow: false,
			}
		},
		onLoad(options) {
			this.listid = options.id
		},
		onShow() {
			this.init()
		},
		methods: {
			init() {
				let _this = this;
				httpRequest.request('/customapi/Salethorder/detail', 'POST', {
					id: this.listid,
					lat: this.lat,
					lng: this.lng
				}, false, false, true).then(res => {
					this.dataAll = res.data
					this.pageShow = true
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	.headerbottom {
		font-size: 28rpx;
		font-weight: bold;
	}

	.headerright {
		text-align: right;
	}

	.margin_topx {
		margin-top: 10rpx;
	}

	.huisetext {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #999999;
	}

	.lansetext {
		font-size: 24rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: bold;
		color: #999999;
	}


	.content {
		padding-top: 30rpx;
	}

	.contentchild {
		font-size: 26rpx;
	}

	.content_child {
		margin: 20rpx 0;
	}

	.headerchild {
		font-size: 32rpx;
		font-weight: bold;
	}

	.headercenter {
		text-align: center;
	}

	.dingdan {
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #666666;
	}

	.heji {
		font-size: 28rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: bold;
		color: #000000;
	}

	.shanpin {
		padding-bottom: 30rpx;
		border-bottom: 2rpx solid rgba(153, 153, 153, 0.05);
	}

	.erbaxs {
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #000000;
	}

	.flex2 {
		flex: 2;
	}

	.flex1 {
		flex: 1.5;
		text-align: right;
	}

	.biankuang {
		margin-top: 10rpx;
	}

	.juli {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #0BBDCB;
	}

	.dizhi {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #737373;
	}

	.daifahuo {
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #F3AD3D;
	}

	.yisongda {
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #0BBDCB;
	}

	.bigtext {
		font-size: 32rpx;
		font-family: PingFang SC-Bold, PingFang SC;
		font-weight: bold;
		color: #000000;
	}

	.normaltxt {
		font-weight: 500;
	}

	.beizhu {
		color: #0BBDCB;
	}

	.xiankuan {
		width: 300rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
</style>